Attribute VB_Name = "conexion"
    
Public cn As ADODB.Connection
'Public rs As New ADODB.Recordset
Public path As String
Public imgPath As String

Public Sub inicio()

    path = App.path
    imgPath = App.path + "\img\"
End Sub

Function obtenerValorIni(sector As String, encabezado As String) As String
    'Dim sSetting As String
    
    'Reads a INI File (SETTINGS.INI) which has SECTION (SQLSERVER) and HEADING (SERVER) in It
    obtenerValorIni = GetINISetting("SQLSERVER", "ADDRESS", App.path & "\SETTINGS.INI")
    'MsgBox sSetting
    
    'Change the above setting to this one
    ''PutINISetting "SQLSERVER", "SERVER", "MyNewSQLServer", App.path & "\SETTINGS.INI"
End Function


Public Sub conectar()
    Dim dirServidor As String
    dirServidor = obtenerValorIni("SQLSERVER", "ADDRESS")
    
    Set conn = New ADODB.Connection
    cadena_conexion = "DRIVER={MySQL ODBC 5.1 Driver}; " _
     & "SERVER=" + dirServidor + ";DATABASE=nuevoJL;" _
     & "PWD=mysql;UID=mysql;OPTION=3"

    
    conn.ConnectionString = cadena_conexion
    conn.Open
    Set cn = conn
'    rs.CursorLocation = adUseClient
End Sub

